﻿using gt.webapi.core.Repositories;
using gt.webapi.core.Repositories.Impl;
using System;
using System.Collections.Generic;

namespace gt.webapi.core.Entity.Options
{
    public class IpLimitOption
    {
        private IIpLimitRepository m_repository = null;

        public IpLimitOption(IIpLimitRepository repository)
        {
            this.m_repository = repository ?? throw new ArgumentNullException("repository");
        }
        public IpLimitOption(List<string> whiteIps)
            : this(new MemoryIpLimitRepository())
        {
            this.m_repository.AddWhiteIps(whiteIps);
        }

        public IIpLimitRepository Repository { get { return m_repository; } }
    }
}
